package com.xiaojianone.order.feign;

import com.xiaojianone.order.feign.fallback.ProductFeignClientFallback;
import com.xiaojianone.product.bean.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


@FeignClient(name = "service-product",fallback = ProductFeignClientFallback.class) // 定义Feign客户端 说明其为发送远程调用请求的客户端
public interface ProductFeignClient {

    @GetMapping("/product/{id}")
    Product getProductById(@PathVariable("id") Long id);

}
